package example.json.controller;

import example.json.voice.DahanVoiceService;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@EnableAutoConfiguration
@RequestMapping("/dahan")
public class DahanController {

    @Resource
    private DahanVoiceService dahanVoiceService;

    @RequestMapping("/voice")
    @ResponseBody
    public String voice(@RequestParam(name = "acc", required = false) String acc,
                        @RequestParam(name = "phones", required = false) String phones,
                        @RequestParam(name = "content", required = false) String content) {
        return dahanVoiceService.voice(acc, phones, content);
    }

}
